#!/usr/local/bin/ruby
#-*- coding: UTF-8 -*-

module Fac
  def fac(i)  #阶乘
    if i < 0
      puts "请输入一个大于等于0的数"
    elsif i == 0 || i == 1
      1
    else
      i*fac(i-1)
    end
  end
end
